package org.setec.config;

import org.setec.utils.xml.XMLUtils;

import java.util.ArrayList;
import java.util.List;

public class InvalidateDetails {

    private String keyIndex;
    private String keyProp;
    private String when;
    private String contextIndex;
    private String contextProp;

    public void setKey(String key) {
        keyIndex = XMLUtils.findFirst(key, "[0-9]+");
        keyProp = XMLUtils.findFirst(key, "\\..*$").replaceAll("^\\.", "");
    }

    public void setContext(String context) {
        contextIndex = XMLUtils.findFirst(context, "[0-9]+");
        contextProp = XMLUtils.findFirst(context, "\\..*$").replaceAll("^\\.", "");
    }

    public String getKeyIndex() {
        return keyIndex;
    }

    public void setKeyIndex(String keyIndex) {
        this.keyIndex = keyIndex;
    }

    public String getKeyProp() {
        return keyProp;
    }

    public void setKeyProp(String keyProp) {
        this.keyProp = keyProp;
    }

    public String getWhen() {
        return when;
    }

    public void setWhen(String when) {
        this.when = when;
    }

    public String getContextIndex() {
        return contextIndex;
    }

    public void setContextIndex(String contextIndex) {
        this.contextIndex = contextIndex;
    }

    public String getContextProp() {
        return contextProp;
    }

    public void setContextProp(String contextProp) {
        this.contextProp = contextProp;
    }
}
